home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / util / boot / ffppatch.readme < prev    next >
Encoding:
Text File  |  1997-09-05  |  7.0 KB  |  225 lines

  1. Short:    Mathffp.library FPU speedup patch 1.5b
  2. Author:   Jess Sosnoski (at the below address!!!)
  3. Uploader: starblaz@postoffice.ptd.net
  4. Version:  1.4beta
  5. Type:     util/boot
  6. Requires: kick 2.04+?, an 020+, and a 68881/2 FPU.
  7.  
  8. Long:
  9.  
  10. FFPpatch 1.5beta © 1997 Jess Sosnoski
  11. Tieee function © 1995 Martin Berndt
  12.  
  13. DESCRIPTION:
  14. -----------
  15. This is a program that patches some functions of the mathffp.library
  16. to use 68881/2 instructions, thus squeezing out a bit more speed.
  17. (I hope!)
  18.  
  19. This is also the first speedup patch I ever attempted to write! :)
  20.  
  21. Works on an '040 or '060 too!
  22. (does not use any FPU trig functions)
  23.  
  24. DISCLAIMER:
  25. ----------
  26. Use this program at your own risk!
  27. I assume no responsibility or liability for problem(s) and/or damage(s)
  28. that occur by the use, modification, and/or existence of this product,
  29. and/or its parts in any form.
  30.  
  31.  But if it don't work right, or slows things down, don't be afraid
  32.  to send me email...or even send some email if it makes your system
  33.  outprocess a cray (yeah, right)
  34.  
  35. Anywayz tho...the following functions are patched, and here's the
  36. speed differences I got with a test program I wrote:
  37.  
  38. *NOTE* The test program must call float() a lot, because when I re-enabled
  39. the SPFloat() patch, the test program ran one hell of a lot faster.
  40.  
  41. I've included the results before I re-enabled the float() patch so you
  42. can see what differences there were.
  43.  
  44. Function    PATCHED        Not_Patched  
  45. -------------------------------------------
  46. SPAbs        2.21        12.02      
  47. SPNeg        2.16        12.20
  48. SPAdd        5.18        18.91
  49. SPSub         5.17        17.78
  50. SPMul        5.18        20.70
  51. SPDiv        5.26        20.96
  52. SPFloat        2.13        11.94
  53. SPFix        2.96        14.26        
  54. SPFloor        2.16        15.13
  55. SPCeil        4.75        27.41
  56.  
  57. (SPTst and SPCmp are also patched)
  58. Hmmm....very interesting.....that's why this patch is a beta :)
  59.  
  60. Your results will likely differ.
  61. (The testprogram isn't the best in the world)
  62.  
  63. INSTALLATION:
  64. ------------
  65. Copy it to your c: directory or wherever you like.
  66. You can add the line run <>NIL: ffppatch to your startup-sequence, or
  67. user-startup.  You can give it an icon and put it in WBstartup.
  68. You can basically put it anywhere :)
  69. (I have mine a little after setpatch in my startup-sequence)
  70.  
  71. USAGE:
  72. -----
  73. run <>NIL: ffppatch
  74.  
  75. OUTPUT:
  76. ------
  77. None...as I didn't feel like figuring out how to to text output
  78. in assembly.
  79. Although, if you don't have the right versions of the required libraries,
  80. it will exit with a returncode of 20.
  81.  
  82. REMOVAL:
  83. -------
  84. sorry....once it's in...it stays in!
  85. (didn't I hear Al Bundy say that to Peg once...hmmm....)
  86.  
  87. CAVEATS:
  88. -------
  89. This patch is experimental, so, don't expect any miracles.
  90.  
  91. Opens mathffp.library, and never closes it.
  92.  
  93. Also...not a whole hell of a lot of programs use mathffp.library, but those
  94. which do may benefit from a little speedup.
  95. (although some garshneblankers, the akJFIF, akLJPG, and akPNG
  96.  datatypes use it)
  97.  
  98. There exists a 68881 card for 68000 owners, but, as I found out via
  99. email, does not access the FPU in the same way that an 020+ would.
  100. I did not include any special code to support this, so it is likely that
  101. this patch may not do anything at all on that type of setup.
  102. (Although, if someone would like to let me know if it does...email me!)
  103.  
  104. NOTES:
  105. -----
  106. mathffp.library is in your Kickstart ROM...you won't find it in libs.
  107. I've noticed that 040 owners are getting horrible results with
  108. a few functions...I'll have to figure something out about it....hmmm...
  109.  
  110.  
  111. FFPTEST
  112. -------
  113. Here it is!   Just type ffptest and it will dump out the results.
  114. It disables multitasking while running.  It does actually give results
  115. with an 040 or 060.  (though the numbers are quite small)
  116.  
  117. The best thing you can do is go into the bootshell, with 
  118. ALL CPU CACHES OFF--leaving them on can give different results with or
  119. without ffppatch when run multiple times (I found this out the hard way)
  120. (trust me, you WILL see a difference)
  121. Note: the testprogram is written in PCQ pascal and may be a bit dodgy.
  122.  
  123.  
  124. cpu NOCACHE    
  125. ffptest
  126.  
  127. run <>NIL: ffppatch
  128. ffptest
  129.  
  130. Then you will see a difference.
  131.  
  132. HISTORY:
  133. -------
  134. 1.0     First Release
  135.  
  136. 1.1    Now closes mathffp.library when mathtrans.lib v40 can't be opened
  137.     Optimized spmul, spdiv, spabs, spneg, spflt, spfloor and squeezed
  138.     a couple more clock cycles out.
  139.     (spadd and spsub optimized too, but disabled cuz they were
  140.      slower for some reason :( )
  141.     Removed SPFix patch...it was slower :(
  142.  
  143. 1.2    Due to my rewriting of ffptest (included), I was able to more
  144.     accurately test speed of calls to mathffp.library.  
  145.     I found out everything went faster in the first place :)
  146.     Re-enabled everything.
  147.  
  148. 1.3    Contacted Martin Berndt, author of fmath40x.lha, and asked
  149.     about the Fieee and Tieee functions....so, he emailed me the
  150.     source...and I removed the mathtrans.library requirement and
  151.     put the functions directly into the patch program, making it
  152.     faster :)
  153.  
  154. 1.4    Longword aligned all patches.
  155.     Changed spabs, spneg and spflt functions to not use fpu...
  156.     they didn't have to do all that work, and were probably horribly
  157.      slower before.
  158.     (worst case..they're probably the same speed as the stock library now
  159.      ..but, one of them can likely be inlined directly into the
  160.        jumptable in some future version to save a clock cycle or two)
  161.     Changed the SPFieee function to a faster one.
  162.     Changed the SPFix function to something more like the original.
  163.  
  164. 1.5    Inlined the SPFieee function whereever possible shaving off more
  165.     clock cycles.
  166.     Included Dave Jones' optimized SPTst and SPCmp functions!
  167.     
  168. FUTURE:
  169. ------
  170. Make this doc file a bit more presentable, and maybe leave it as plain
  171. text without Amigaguide OR HTML just for kicks.
  172. Write a more accurate test program, and maybe include it in the archive.
  173.  
  174. Make a GOOD ffptest speedtest program. (in assembly)
  175.  
  176. Maybe add command line-arguments to turn on/off selected patches.
  177.  
  178. Make the patch exit, instead of hanging around.
  179.  
  180. One word: APATCH (if this patch turns out to work as I'd like it to)
  181.  
  182. THANKS TO:
  183. ---------
  184. Martin Berndt...for sending me the sourcecode to Tieee and Fieee
  185. functions from his fmath40x mathtrans.library.
  186.  
  187. Adam "DC1" Polosnik for ideas, help with sourcecode, and APATCH!
  188.  
  189. Dave "Termy" Jones, for help, ideas, optimized functions,  and StreamLineOS 2!
  190.  
  191. Everyone who sent me emails, praise, and complaints....your input
  192. was greatly appreciated!!!!
  193.  
  194. BUGS:
  195. ----
  196. Hmmm...what would Tom say, ohyeah, um....possibly.
  197. Crummy speedtest program.
  198.  
  199. AUTHOR:
  200. ------
  201. Jess Sosnoski
  202. 651 Hillside Drive
  203. Mount Carmel, PA 17851-2463
  204. USA
  205.  
  206. starblaz@postoffice.ptd.net
  207. http://home.ptd.net/~starblaz
  208.  
  209. IRC nick: starblaz
  210. On: galaxynet (#amichat), beyondirc (#styx, #amirc), dalnet (#nin ,#c-64)
  211.  
  212. Emails, gifts, money, food, cigarettes, Amiga4060T's will all be
  213. gladly accepted.
  214.  
  215.  
  216. ============================= Archive contents =============================
  217.  
  218. Original  Packed Ratio    Date     Time    Name
  219. -------- ------- ----- --------- --------  -------------
  220.      848     511 39.7% 20-Jul-97 17:05:36  ffppatch
  221.     6678    3303 50.5% 20-Jul-97 17:13:58  ffppatch.readme
  222.     7056    3673 47.9% 20-Jul-97 17:14:02  ffptest
  223. -------- ------- ----- --------- --------
  224.    14582    7487 48.6% 29-Jul-97 00:04:56   3 files
  225.